import axios from 'axios';
import {ALL_SERVICE_API} from '../api';
var qs = require('qs');

const STM_PARAMS = ALL_SERVICE_API + '/stm-params-vo';
const STM_PARAM = ALL_SERVICE_API + '/stm-params';
const STM_PARAM2 = ALL_SERVICE_API + '/stm-params/';
const STM_PARAMS_MODIFY_STATUS = ALL_SERVICE_API + '/stm_params_modify_status';

// 获取列表
export const searchStmParam = params => {
  return axios.get(STM_PARAMS, {params: params});
};
// 保存系统配置
export const saveStmParam = (params) => {
  return axios.put(STM_PARAM, params);
};
// 删除系统配置
export const delStmParam = id => {
  return axios.delete(STM_PARAM2 + id);
};
// 批量启用/停用
export const batchStart = (id, status) => {
  return axios.post(STM_PARAMS_MODIFY_STATUS, qs.stringify({id: id, status: status}));
};
